package com.hejing.面向对象特征之二_继承.初识继承;

/**
 * ClassName: Person
 * Package: com.hejing.面向对象特征之二_继承
 * Description:
 *
 * @Author: HeJing
 * @Create: 2023-03-25 18:56
 * @Version: 1.0
 */
public class Person {
    // 属性
    String name;
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    // 方法
    public void eat() {
        System.out.println("人吃饭");
    }

    public void sleep() {
        System.out.println("人睡觉");
    }
}






















